Add TAL-Reverb-II plugin to test
[juce-lv2.git] / juce / source / extras / the jucer / src / jucer_Main.cpp
blobc66d5a30913639e0a54e4dc061086c053eb92969
1 /*
2 ==============================================================================
4 This file is part of the JUCE library - "Jules' Utility Class Extensions"
5 Copyright 2004-11 by Raw Material Software Ltd.
7 ------------------------------------------------------------------------------
9 JUCE can be redistributed and/or modified under the terms of the GNU General
10 Public License (Version 2), as published by the Free Software Foundation.
11 A copy of the license is included in the JUCE distribution, or can be found
12 online at www.gnu.org/licenses.
14 JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 ------------------------------------------------------------------------------
20 To release a closed-source product which uses JUCE, commercial licenses are
21 available: visit www.rawmaterialsoftware.com/juce for more information.
23 ==============================================================================
26 #include "jucer_Headers.h"
27 #include "ui/jucer_MainWindow.h"
29 ApplicationCommandManager* commandManager = 0;
32 //==============================================================================
33 class JucerApplication : public JUCEApplication
35 MainWindow* theMainWindow;
37 public:
38 //==============================================================================
39 JucerApplication()
40 : theMainWindow (0)
44 ~JucerApplication()
48 //==============================================================================
49 void initialise (const String& commandLine)
51 commandManager = new ApplicationCommandManager();
53 theMainWindow = new MainWindow();
54 theMainWindow->setVisible (true);
56 ImageCache::setCacheTimeout (30 * 1000);
58 if (commandLine.trim().isNotEmpty()
59 && ! commandLine.trim().startsWithChar ('-'))
60 anotherInstanceStarted (commandLine);
63 void shutdown()
65 delete theMainWindow;
66 theMainWindow = 0;
68 deleteAndZero (commandManager);
71 //==============================================================================
72 void systemRequestedQuit()
74 if (theMainWindow == 0 || theMainWindow->closeAllDocuments())
76 deleteAndZero (theMainWindow);
78 StoredSettings::deleteInstance();
80 quit();
84 //==============================================================================
85 const String getApplicationName()
87 return "The Jucer";
90 const String getApplicationVersion()
92 return String (JUCER_MAJOR_VERSION) + "." + String (JUCER_MINOR_VERSION);
95 bool moreThanOneInstanceAllowed()
97 #ifndef JUCE_LINUX
98 return false;
99 #else
100 return true; //xxx should be false but doesn't work on linux..
101 #endif
104 void anotherInstanceStarted (const String& commandLine)
106 if (theMainWindow != 0 && commandLine.unquoted().isNotEmpty())
107 theMainWindow->openFile (commandLine.unquoted());
112 START_JUCE_APPLICATION(JucerApplication)